Skip to main content

DATEVALUE

Converts a date in the form of text to a number that represents the date in the date-time code.

Syntax

expression.DATEVALUE(arg1);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRangeApiNamestring

Returns

number

Example

const oWorksheet = Api.GetActiveSheet();

var oFunction = Api.GetWorksheetFunction();
var ans = oFunction.DATEVALUE("2018-3-16");

oWorksheet.GetRange("C1").SetValue(ans);